MODULE_NAME				:= linkclient

TARGET_NAME				:= lib$(MODULE_NAME)
SRCS					:= $(MODULE_NAME).cpp

LINKFLAG				+=

ENV_INCLUDE_PATH		?= build.env

include $(ENV_INCLUDE_PATH)

preinstall:: $(MODULE_NAME).h
	cp -raf $< $(INC_INSTALL_PATH)/$(TARGET_NAME).h

install:: $(TARGET_NAME).so
	cp -raf $(TARGET_NAME).so $(LIB_INSTALL_PATH)

$(TARGET_NAME).so: $(OBJS)
	$(CPP) $(LDFLAG) -shared -Wl,-soname,$@ -o $@ $^ $(LINKFLAG)

$(TARGET_NAME).a: $(OBJS)
	$(AR) rcv $@ $^

clean::
	rm -rf *.o *.d *.a *.so $(TARGET_NAME).h

distclean::
	make -C . clean
